#include "Gosub.h"


Gosub::Gosub(Expr *_expr, vm *_env, int _ln)
    :dest(_expr), env(_env), Stmt(_ln)
{
}


Gosub::~Gosub(void)
{
}

int Gosub::Eval()
{
    env->PushFunc();

    if (dest->Type() == INT)
        return dest->EvalInt();
    else if (dest->Type() == FLT)
        return (int)dest->EvalFlt();
    else
    {
        assert(0);
        return -1;
    }
}
